﻿
function StaffController($scope, service, $routeParams, $location, $http) {
    $scope.myRadioFilter = {
        WorkingStatus: 1
    };

    $scope.myStore = "";

    $scope.myFilterInput = "";
    //get data of Store list api/storelist/1
    $http.get(service.locationUrl + "/companystore/companyid/" + service.infoUser.Id, {})
        .success(function (data) {
            $scope.rowsStoreList = data;
        })
        .error(function (err) {

            console.log("error", err);
        });
   
    // get staff list by company id
    $http.get(service.locationUrl + "/viewstaffbycompany/" + service.infoUser.Id, {})
        .success(function (data) {
            $scope.staffRowsData = data;
        })
        .error(function (err) {

            console.log("error", err);
        });

    $scope.edit = function (id)
    {
        $location.path("/StaffEdit/" + id).search
        ({
            type : "Edit"
        });
    }
    $scope.createNew = function ()
    {
        $location.path("/StaffEdit").search
        ({
            type : "New"
        })
    }
}